{% assign topnav = site.data[page.topnav].topnav[page.lang] %}

<div class="header-container">
  <header class="header">
    <div class="header__content container">
      <div class="header__left-box">
        <div class="header__logo">
          <a href="/" class="header__logo">
            <svg xmlns="http://www.w3.org/2000/svg" width="157" height="52" fill="none" viewBox="0 0 157 52"><g id="logo"><g id="sign"><path id="Vector" fill="#0064FF" d="M27.43 33.1h-7.06V18.9h7.06a7.1 7.1 0 0 1 0 14.2Z"/><g id="Group"><g id="Group_2" fill="#00003C"><path id="Vector_2" d="m14.32 19.73-3.79-3.8L.5 26l10.04 10.07 3.78-3.9-1.94-1.85v-8.64l1.94-1.95Z"/><path id="Vector_3" d="m42.28 15.93-3.8 3.8 1.85 1.95v8.64l-1.84 1.85 3.79 3.9L52.3 26 42.28 15.93Z"/><path id="Vector_4" d="m16.37 10.07 3.79 3.8 1.95-1.95h8.6l1.84 1.95 3.9-3.8L26.4 0 16.37 10.07Z"/><path id="Vector_5" d="m34.5 39.98-1.95-1.85-1.84 1.85h-8.6l-1.95-1.85-1.84 1.85-1.95 1.95L26.41 52l10.03-10.07-1.94-1.95Z"/></g></g></g><g id="Deckhouse" fill="#0064FF"><path d="M69.22 19.85c3.39 0 5.84 2.43 5.84 5.77a5.61 5.61 0 0 1-5.84 5.76h-4.35V19.85h4.35Zm-.05 9.23c1.97 0 3.34-1.45 3.34-3.46 0-2.04-1.37-3.44-3.34-3.44h-1.81v6.9h1.8ZM85.54 26.92c0 .23-.01.46-.05.7h-6.73c.21 1.21 1 1.89 2.17 1.89.84 0 1.53-.4 1.9-1.04h2.51a4.54 4.54 0 0 1-4.4 3.18 4.58 4.58 0 0 1-4.62-4.71c0-2.67 1.98-4.7 4.61-4.7 2.73 0 4.61 2.11 4.61 4.68Zm-4.6-2.62c-1.08 0-1.84.63-2.12 1.68h4.32c-.35-1.09-1.12-1.68-2.2-1.68ZM91.39 31.65a4.65 4.65 0 0 1-4.73-4.73 4.6 4.6 0 0 1 4.74-4.68c2.31 0 4.09 1.47 4.52 3.66h-2.4a2.28 2.28 0 0 0-2.13-1.4c-1.3 0-2.3 1.05-2.3 2.44 0 1.36 1.01 2.43 2.3 2.43.97 0 1.73-.52 2.14-1.48h2.42a4.5 4.5 0 0 1-4.56 3.76ZM105.93 31.38h-2.91l-2.85-4.25v4.25h-2.4V19.3h2.4v7.15l2.66-3.95h2.77l-3.01 4.25 3.34 4.64ZM112.1 22.3c2 0 3.26 1.43 3.26 3.68v5.4h-2.4V26.4c0-1.33-.49-1.99-1.56-1.99-1.2 0-1.99.87-1.99 2.32v4.66h-2.4V19.3h2.4v4.04a3.86 3.86 0 0 1 2.68-1.04ZM121.77 31.65a4.65 4.65 0 0 1-4.8-4.71c0-2.69 2.05-4.7 4.8-4.7s4.81 2.01 4.81 4.7a4.65 4.65 0 0 1-4.8 4.7Zm0-2.28c1.39 0 2.37-.98 2.37-2.43 0-1.44-.98-2.44-2.37-2.44-1.38 0-2.37 1-2.37 2.44 0 1.45.99 2.43 2.37 2.43ZM132.37 31.65c-2.5 0-4.19-1.62-4.19-4.02v-5.14h2.4v4.88c0 1.26.68 2 1.79 2 1.12 0 1.78-.75 1.78-2v-4.88h2.4v5.14c0 2.4-1.66 4.02-4.18 4.02ZM141.88 31.65c-2.22 0-3.72-1.29-3.72-3.18h2.34c.02.79.63 1.18 1.48 1.18.66 0 1.27-.3 1.27-.9 0-.61-.77-.8-1.71-.94-1.42-.25-3.23-.63-3.23-2.72 0-1.68 1.43-2.85 3.57-2.85 2.15 0 3.56 1.2 3.58 2.98h-2.3c0-.7-.5-1.05-1.34-1.05-.74 0-1.19.33-1.19.84 0 .6.76.74 1.68.9 1.45.27 3.31.57 3.31 2.74 0 1.81-1.48 3-3.74 3ZM156.02 26.92c0 .23-.01.46-.05.7h-6.73c.21 1.21 1 1.89 2.17 1.89.84 0 1.53-.4 1.9-1.04h2.51a4.54 4.54 0 0 1-4.4 3.18 4.58 4.58 0 0 1-4.62-4.71c0-2.67 1.97-4.7 4.61-4.7 2.74 0 4.61 2.11 4.61 4.68Zm-4.6-2.62c-1.08 0-1.84.63-2.12 1.68h4.32c-.35-1.09-1.12-1.68-2.2-1.68Z"/></g></g></svg>
          </a>
        </div>
        <ul id="top-header-nav" class="nav header__nav">
          {% for entry in topnav %}
            {% for item in entry.items %}
              {%- if site.mode == 'module' and item.ee_only and site.d8Revision != 'EE' %}{% continue %}{% endif %}
              {%- assign item_url_parts = item.url | split: '/' -%}
              {%- assign is_getting_started_item = page_url_without_lang | startswith: '/gs/' -%}
              <li class="header__navigation-item
                {%- if page.mode == 'ssi' and site.mode != 'module' and item_url_parts[1] == 'documentation' %} header__navigation-item_active{% endif %}
                {%- if page.mode != 'ssi' and is_getting_started_item and item.url == '/gs/' %} header__navigation-item_active{% endif %}
                {%- if item.url.size>1 and page.url == item.url %} header__navigation-item_active{% endif %}
                {%- if page_url_without_lang == item.url %} header__navigation-item_active{% endif %}
                {%- if item.items %} current-menu-parent menu-item-has-children{% endif %}
                {%- if item.url.size<2 and page.url.size<2 %} header__navigation-item_active{% endif %}"
                {%- if item.items %} data-proofer-ignore{% endif %}
              >
                <a {% if item.url %}href="{% if site.mode == 'module' %}/{{ page.lang }}/platform{% endif %}{{ item.url }}"{% else %}href="#"{% endif %}{% if item.target.size > 0 %} target="{{ item.target }}"{% endif %}>{{- item.title -}}</a>

                {% if item.items %}
                  <div class="sub-menu-container">
                    <ul class="sub-menu">
                      {% for subitem in item.items %}
                        {%- assign item_url_parts = subitem.url | split: '/' -%}
                        <li data-proofer-ignore>
                          <a
                            {%- if subitem.external_url %}
                              href="{{ subitem.external_url }}"
                            {%- elsif subitem.url %}
                              href="{% if site.mode == 'module' %}/{{ page.lang }}/platform{% endif %}{{ subitem.url }}"
                            {%- else %}
                              href="#"
                            {% endif %}
                            {%- if subitem.target.size > 0 %} target="{{ subitem.target }}"{% endif %}
                            >
                              {{ subitem.title }}
                            </a>
                        </li>
                      {% endfor %}
                    </ul>
                  </div>
                {% endif %}
              </li>
            {% endfor %}
          {% endfor %}
        </ul>
      </div>
      <div class="header__right-box">
        {%- if site.mode == 'module' %}
        <span class='updatechannel__content disable'>&nbsp;</span>
        {%- else %}
        <div class="socials">
          <a href="https://github.com/deckhouse/deckhouse" target="_blank">
            <svg xmlns="http://www.w3.org/2000/svg" width="68" height="66" viewBox="0 0 68 66" fill="none"><path d="M34 0C15.215 0 0 15.141 0 33.8346C0 48.8065 9.73257 61.4521 23.2475 65.9352C24.9475 66.2313 25.585 65.2162 25.585 64.3282C25.585 63.5246 25.5424 60.8602 25.5424 58.0265C16.9999 59.5914 14.7899 55.9541 14.11 54.051C13.7274 53.0782 12.0699 50.0754 10.625 49.2718C9.435 48.6374 7.735 47.0727 10.5824 47.0303C13.2599 46.988 15.1725 49.4833 15.81 50.4983C18.87 55.6157 23.7575 54.1778 25.7125 53.2897C26.0099 51.0904 26.9025 49.61 27.88 48.7643C20.315 47.9184 12.41 45.0002 12.41 32.0584C12.41 28.3789 13.7276 25.3338 15.8949 22.9654C15.555 22.1195 14.365 18.6515 16.235 13.9992C16.235 13.9992 19.0824 13.1111 25.585 17.4673C28.305 16.706 31.1949 16.3253 34.085 16.3253C36.975 16.3253 39.865 16.706 42.585 17.4673C49.0875 13.0688 51.935 13.9992 51.935 13.9992C53.805 18.6515 52.615 22.1195 52.275 22.9654C54.4425 25.3338 55.7599 28.3366 55.7599 32.0584C55.7599 45.0424 47.8124 47.9184 40.2474 48.7643C41.4799 49.8216 42.5424 51.8518 42.5424 55.0238C42.5424 59.5491 42.4999 63.1864 42.4999 64.3284C42.4999 65.2164 43.1375 66.2737 44.8374 65.9354C58.2674 61.4521 68 48.7642 68 33.8346C68 15.141 52.785 0 34 0Z" fill="white"></path></svg>
          </a>
        </div>
        {%- endif %}
        {%- if page.lang == "ru" %}
          <a class="language-button" href="
            {%- if site.mode == 'module' %}/en
              {%- if page_url_without_lang %}{{ page_url_without_lang }}{% else %}/{%- endif %}
            {%- else -%}
              {%- if page.mode == 'ssi' -%}
                {{ site.urls['en'] }}{% raw %}{{ .MenuDocumentationLink }}{{ .CurrentPageURLRelative }}{% endraw %}
              {%- else -%}
                {{ site.urls['en'] }}{%- if page_url_without_lang %}{{ page_url_without_lang }}{% else %}/{%- endif %}
              {%- endif %}
            {%- endif %}"
          >
            En
        {%- else %}
          <a class="language-button" href="
            {%- if site.mode == 'module' %}/ru
              {%- if page_url_without_lang %}{{ page_url_without_lang }}{% else %}/{%- endif %}
            {%- else -%}
              {%- if page.mode == 'ssi' -%}
                {{ site.urls['ru'] }}{% raw %}{{ .MenuDocumentationLink }}{{ .CurrentPageURLRelative }}{% endraw %}
              {%- else -%}
                {{ site.urls['ru'] }}{%- if page_url_without_lang %}{{ page_url_without_lang }}{% else %}/{%- endif %}
              {%- endif %}
            {%- endif %}"
          >
          Ru
        {%- endif %}
          </a>
      </div>
    </div>
  </header>
</div>
